﻿using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;

using WindowsFormsElementApp.ControlExtension.Theme;

namespace WindowsFormsElementApp.Controls
{
    public class CMButtonPlus : CMButtonPlusBasic
    {
        //[Description("主题")]
        private Theme Theme { get => _theme; set => _theme = value; }

        [Description("样式预设")]
        public StyleScene StyleScene { get; set; }

        protected override void OnPaint(PaintEventArgs e)
        {
            switch (StyleScene)
            {
                case StyleScene.Square_Hollow_Plain:
                    Paint(5, ThemeColorFactory.GetThemeColor(Theme).ColorPrimary.Brighten(50), ThemeColorFactory.GetThemeColor(Theme).ColorPrimary, ThemeColorFactory.GetThemeColor(Theme).ColorPrimary
                        , ThemeColorFactory.GetThemeColor(Theme).ColorPrimary.Brighten(80), ThemeColorFactory.GetThemeColor(Theme).ColorPrimary, ThemeColorFactory.GetThemeColor(Theme).ColorPrimary
                        , ThemeColorFactory.GetThemeColor(Theme).ColorBackgroundBase, ThemeColorFactory.GetThemeColor(Theme).ColorFontRegular, ThemeColorFactory.GetThemeColor(Theme).ColorBorderBase);
                    break;
                case StyleScene.Square_Hollow_Primary:
                    break;
                case StyleScene.Square_Hollow_Success:
                    break;
                case StyleScene.Square_Hollow_Info:
                    break;
                case StyleScene.Square_Hollow_Warning:
                    break;
                case StyleScene.Square_Hollow_Danger:
                    break;
                case StyleScene.Square_Soild_Primary:
                    break;
                case StyleScene.Square_Soild_Success:
                    break;
                case StyleScene.Square_Soild_Info:
                    break;
                case StyleScene.Square_Soild_Warning:
                    break;
                case StyleScene.Square_Soild_Danger:
                    break;
                case StyleScene.Round_Hollow_Plain:
                    break;
                case StyleScene.Round_Hollow_Primary:
                    break;
                case StyleScene.Round_Hollow_Success:
                    break;
                case StyleScene.Round_Hollow_Info:
                    break;
                case StyleScene.Round_Hollow_Warning:
                    break;
                case StyleScene.Round_Hollow_Danger:
                    break;
                case StyleScene.Round_Soild_Plain:
                    break;
                case StyleScene.Round_Soild_Primary:
                    break;
                case StyleScene.Round_Soild_Success:
                    break;
                case StyleScene.Round_Soild_Info:
                    break;
                case StyleScene.Round_Soild_Warning:
                    break;
                case StyleScene.Round_Soild_Danger:
                    break;
                default:
                    break;
            }

            base.OnPaint(e);
        }

        private void Paint(int radius,
            Color hoverBackColor,
            Color hoverForeColor,
            Color hoverBorderColor,
            Color pressBackColor,
            Color pressForeColor,
            Color pressBorderColor,
            Color enableBackColor,
            Color enableForeColor,
            Color enableBorderColor)
        {
            Radius = radius;

            HoverBackColor = hoverBackColor;
            HoverForeColor = hoverForeColor;
            HoverBorderColor = hoverBorderColor;
            PressBackColor = pressBackColor;
            PressForeColor = pressForeColor;
            PressBorderColor = pressBorderColor;
            EnableBackColor = enableBackColor;
            EnableForeColor = enableForeColor;
            EnableBorderColor = enableBorderColor;
        }
    }
}